<extend name="Public/base"/>
<block name="body">
    <div class="main-title">
        <h2>{:L("_AUTOMATIC_UPGRADE_")}-{:L("_COMPLETE_")}</h2>
    </div>
    <div class="with-padding" style="width:700px;">
        <div class="alert alert-info">
            <p>{:L("_CURRENT_SYSTEM_VERSION_NUMBER_")}<strong>{$currentVersion.name}</strong></p>
        </div>
        <p><strong class="text-success">1.{:L("_DOWNLOAD_THE_UPDATE_PACKAGE_AND_GET_THE_UPDATED_FILE_LIST_")}-》 2.{:L("_LOCAL_FILE_CONTRAST_")}-》 3.{:L("_CODE_UPGRADE_")}-》 4.{:L("_DATABASE_UPGRADE_")}-》{:L("_UPGRADE_")}</strong></p>
        <h4>
           {:L("_CONGRATULATIONS_THE_UPGRADE_IS_SUCCESSFUL_THE_CURRENT_VERSION_IS_")}{$currentVersion.name}
        </h4>

        <p>{:L("_IF_YOU_FIND_A_PROBLEM_AFTER_THE_UPGRADE_PLEASE_FIND_THE_BACKUP_FILE_AND_RESTORE_THE_BACKUP_DATABASE_")}</p>


        <p>
            {$path}/backup

        </p>

        <div class="row">
            <div class="col-xs-7">
                <a id="compare_btn" class="btn btn-success btn-block"
                  href="{:U('update')}">{:L("_RETURN_HOME_PAGE_")}</a>
            </div>

        </div>

    </div>


    <script>
        function updateDB(obj) {
            if (!confirm({:L('_OK_IMPORT?_STRONGLY_RECOMMENDED_FOR_DATABASE_BACKUP_BEFORE_IMPORT_WITH_SINGLE_')})) {
                return false;
            } else {
                toast.showLoading();
                $(obj).attr('disabled', 'disabled');
                $(obj).text('{:L("_IS_UPGRADING_THE_DATABASE_PLEASE_WAIT_PATIENTLY_")}……');
                $.post('__SELF__', function (msg) {
                    if (msg.status) {
                        $(obj).removeAttr('disabled');
                        toast.hideLoading();
                        toast.success({:L('_DATABASE_UPGRADE_SUCCESSFULLY_WITH_SINGLE_')});
                        $(obj).text({:L('_UPGRADE_DATABASE_SUCCESSFULLY_ENTER_NEXT_WITH_SINGLE_')});
                        $(obj).attr('href',"{:U('finish')}");

                    } else {
                        toast.error({:L('_UPGRADE_FAILED._PLEASE_CHECK_IT_AND_TRY_AGAIN_WITH_SINGLE_')})
                    }
                })
            }
        }
        function writeFile($data) {
            $('#file').append('<div><i class="icon-file"></i> ' + $data + '</div>');
        }
        function writeMessage($data) {
            $('#message').append($data);
        }
        function replaceMessage($data) {
            $('#message').children().last().remove();
            $('#message').children().last().remove();
            $('#message').append($data);
        }
        var progress = {
            'show': function () {
                $('#progress').parent().show();
            },
            'setValue': function ($value) {
                $('#progress').css('width', $value);
            },
            'hide': function () {
                $('#progress').parent().hide();
            }
        };
        function enable() {
            $('#compare_btn').removeAttr('disabled', '');
        }
    </script>
</block>